Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Image Masks

Labels

ASCII
ImageMask
Binary
immk ( = 0x696D6D6B )

Data Format

Uns32               width
Uns32               height
Uns32               rowBytes
RawData             image[rowBytes * height]
width
The width, in bits, of the bitmap whose bits are listed in the array image[] . The value in this field should be greater than 0.
height
The height, in bits, of the bitmap whose bits are listed in the array image[] . The value in this field should be greater than 0.
rowBytes
The number of bytes in a row of the bitmap.
image[]
An array of bit specifications.

Data Size

12 + (rowBytes * height) + padding

Description

An image mask is a bitmap that is used to mask out certain portions of an image. The values in the width and height fields of an image mask specify the boundaries of the rectangular subregion of an image that is actually to be drawn. (Width and height are measured from the upper-left corner of the image to which a mask is applied.) Each bit listed in the array images[] corresponds to 1 pixel in the rectangle defined by the width and height of the mask. If a bit is set, then the corresponding pixel is drawn with the color determined by the underlying image. If a bit is clear, then the corresponding pixel is drawn black. Normally, an image mask is applied to an image after that image has been rasterized.

An image dimensions object may be used together with an image mask: the former may be used to clip an image, and the latter may be used to filter the clipped image.

Parent Hierarchy

Data, view hints data.

Parent Objects

View hints. An image mask always has a parent object.

Child Objects

None.

Example

3DMetafile ( 1 0 Normal toc> )
Container (
    ViewHints ( )
    ImageDimensions ( 32 32 )
    ImageClearColor ( 1 1 1 )
    ImageMask (
        32 32                                               # width, height
        4                                                   # rowBytes
        BigEndian                                           # bitOrder
        0x000000000FFFF8000FFFF8000FFFF800
        0x0FFFF8000FFFF8000FFFF8000FFFFFE0
        0x0FFFFFE00FFFFFE00FFFFFE00FFFFFE0
        0x0FFFFFE00FFFFFE00FFFFFE00FFFFFE0
        0x0FFFFFE00FFFFFE00FFFFFE00FFFFFE0
        0x0FFFFFE00FFFFFE00FFFFFE00FFFFFE0
        0x0C61FFE00F24FFE00E64FFE00F24FFE0
        0x0F24FFE00C61FFE00FFFFFE000000000
    )
)
Rotate ( X 0.25 )
Rotate ( Y 0.23 )
Container (
    Torus ( 0 0.7 0 0 0 1 1 0 0 0 0 0 0.7 )
    Container (
        AttributeSet ( )
        DiffuseColor ( 0.2 0.9 0.9 )
    )
)

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |